home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: news.inap.net!news1!news
- From: potterb@iquest.net (Brad Potter)
- Subject: Problems Porting clcc code from sun/os to solaris
- X-Nntp-Posting-Host: ind-015-238-82.iquest.net
- Message-ID: <Dq3A9u.17H@iquest.net>
- Sender: news@iquest.net (News Admin)
- Organization: IQuest Network Services
- X-Newsreader: WinVN 0.91.6
- Date: Fri, 19 Apr 1996 03:13:05 GMT
-
- I really need some help with this. I am in the process of converting C
- code from SUN/OS to Solaris. I am using Centerline C version 4.1.1. The
- program works fine in SUN/OS, but when I compile it and run it on a
- solaris machine, it appears to run into some sort of buffering problem.
- This is what I know so far.
-
- The program opens a text file using fopen(filename, "r+u") option so that
- the text will be unbuffered (a known bug) and in update mode. By the
- time the program has determined if we will process the line the pointer
- is sitting on the EOF marker. We want to mark the line as Processed by
- placing a 'P' in the last position of the line before the EOL marker. I
- am using fseek(filename, -2, SEEKCUR) to back the pointer up 2 places. I
- then use a fputc('P', filename) to add a 'P' as the last character in the
- file.
-
- What happens is that not only does the 'P' get added to the last position
- but also 30 - 40 other characters get attached as well. I have contacted
- Centerline about this problem and they suggested that the problems lies
- in the /lib/libc.a library. The latest update to this library that I
- have used is dated April 11, 1995.
-
- I am really stuck on this. I hope there is someone out there that has
- run into this problem and can help me with a fix. We have several vender
- c programs that use fopen(filename, "r+u") that I have not yet tested but
- will be doing so in the near future.
-
- Any suggestions and/or help is greatly appreciated.
-